var vm = new Vue({
	el:'#app',
	data:{
	number:"",
	prop: ""
	},
	 components: {
        "header-com" : headerCom,
		"count-com" : countCom,
		"popup-com" : popupCom
    },
    methods:{
    	oneHun:function(){
    		this.number = 100;
    	},
    	thrHun:function(){
    		this.number = 300;
    	},
    	oneTho:function(){
    		this.number = 1000;
    	},
    	twoTho:function(){
    		this.number = 2000;
    	},
    	thrTho:function(){
    		this.number = 3000;
    	},
    	modify:function(){
    		this.number = ""
    	},
    	cancel:function(){
    		window.location.href = "../business";
    	},
    	Submission:function(){
			if(this.number == ""){
				this.prop = "请选择存款金额";
				return false;
			}
    		if (this.number%100 !== 0) {
				this.prop = "请输入100的整数倍";
    		}else if (this.number > 10000) {
				this.prop = "一次最多存款1万元人民币";
    		}else{
    			const num = Qs.stringify({
				"Money": this.number
			})
    		axios.post("./deposit",num)
            .then((res) => {
				console.log(res.data);
               	var code = res.data.code;
                var describe = res.data.data.describe;
                switch (code){
					case 811:
					this.prop = "交易失败";
					break;
                    case 0:
                    window.location.href = "./depositSuccess";
					break;
                    case 211:
					this.prop = describe;
					break;
                    case 212:
					this.prop = describe;
					break;
                    case 213:
					this.prop = describe;
					break;
                    case 221:
					this.prop = describe;
                    break;
                    case 222:
					this.prop = "存款金额超出当前atm最大容量，当前可存金额为"+ res.data.data+"元";
                    break;
                }
            })
            .catch(function(error) {
                alert(error);
            })
    		}
    		

    	}
    }
})
